import {Actor, Action} from 'iflux2';
import {fromJS} from 'immutable';

import {SearchActionType} from '../constant/action-type';


export default class SearchActor extends  Actor {
    defaultState() {
        return {
            filterKey: 'ALL',
            search:{
                simpleType:'',
                simpleValue:""
            }
        }
    }


    /**
     * 设置订单状态
     * @param state
     * @param filterKey
     */
    @Action(SearchActionType.SET_SEARCH_FILTER)
    setFilter(state, filterKey) {
        return state.set('filterKey', filterKey);
    }

    @Action(SearchActionType.SET_SEARCH_PARAMS)
    changeSearchParam(state,params){
        return state.set("search",params)
    }

    /**
     * 修改分页信息
     * @param state
     * @param pagination
     */
    // @Action(SearchActionType.CHANGE_SEARCH_PAGINATION)
    // changePagination(state, pagination) {
    //     return state.update('pagination', (page)=>page.merge(pagination));
    // }
}